package com.custom.gobang

import android.annotation.SuppressLint
import android.os.Bundle
import android.view.View
import android.view.Window

import android.view.WindowManager
import androidx.appcompat.app.AppCompatActivity
import kotlinx.android.synthetic.main.activity_main.*

class MainActivity : AppCompatActivity() {

    @SuppressLint("SetTextI18n")
    override fun onCreate(savedInstanceState: Bundle?) {
        val window: Window = window
        window.run {
            setFlags(
                WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS,
                WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS
            )
        }
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION)
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS)
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        gobanView.setonCalledIsFinish(object : GobanView.onCalledIsFinish {
            override fun isFinsh(isfinish: Boolean) {
                if (isfinish) {
                    btn_play.visibility = View.VISIBLE
                } else {
                    btn_play.visibility = View.INVISIBLE
                }
            }
        })
        btn_play.setOnClickListener {
            gobanView.play()
        }
    }

}
